package o;

import android.content.res.ColorStateList;
import android.graphics.PorterDuff.Mode;
import android.graphics.drawable.Drawable;
import android.os.Build.VERSION;
import android.widget.TextView;
import androidx.core.widget.TextViewCompat;
import com.huawei.skinner.annotation.SkinAdapter;
import o.fkp.e;

public class ftu {
    @SkinAdapter("textColor")
    public static void ˏ(TextView textView, ColorStateList colorStateList) {
        textView.setTextColor(colorStateList);
    }

    @SkinAdapter("textColorHint")
    public static void ˊ(TextView textView, ColorStateList colorStateList) {
        textView.setHintTextColor(colorStateList);
    }

    @SkinAdapter("drawableTint")
    public static void ॱ(TextView textView, ColorStateList colorStateList) {
        if (VERSION.SDK_INT >= 23) {
            textView.setCompoundDrawableTintList(colorStateList);
            return;
        }
        ˎ(textView, colorStateList);
        textView.setTag(e.ॱ, colorStateList);
    }

    @SkinAdapter("drawableTop")
    public static void ˊ(TextView textView, Drawable drawable) {
        ˏ(textView, "drawableTop", drawable);
    }

    @SkinAdapter("drawableBottom")
    public static void ˏ(TextView textView, Drawable drawable) {
        ˏ(textView, "drawableBottom", drawable);
    }

    @SkinAdapter("drawableLeft")
    public static void ˋ(TextView textView, Drawable drawable) {
        ˏ(textView, "drawableLeft", drawable);
    }

    @SkinAdapter("drawableRight")
    public static void ˎ(TextView textView, Drawable drawable) {
        ˏ(textView, "drawableRight", drawable);
    }

    @SkinAdapter("drawableStart")
    public static void ॱ(TextView textView, Drawable drawable) {
        ˏ(textView, "drawableStart", drawable);
    }

    @SkinAdapter("drawableEnd")
    public static void ॱॱ(TextView textView, Drawable drawable) {
        ˏ(textView, "drawableEnd", drawable);
    }

    private static void ˏ(TextView textView, String str, Drawable drawable) {
        Drawable[] compoundDrawables = textView.getCompoundDrawables();
        Drawable[] ˎ = TextViewCompat.ˎ(textView);
        int i = -1;
        switch (str.hashCode()) {
            case -2056911842:
                if (str.equals("drawableRight")) {
                    i = 3;
                    break;
                }
                break;
            case -2055666076:
                if (str.equals("drawableStart")) {
                    i = 0;
                    break;
                }
                break;
            case 208115817:
                if (str.equals("drawableBottom")) {
                    i = 5;
                    break;
                }
                break;
            case 574382941:
                if (str.equals("drawableEnd")) {
                    i = 1;
                    break;
                }
                break;
            case 574397399:
                if (str.equals("drawableTop")) {
                    i = 4;
                    break;
                }
                break;
            case 626202053:
                if (str.equals("drawableLeft")) {
                    i = 2;
                    break;
                }
                break;
        }
        switch (i) {
            case 0:
                TextViewCompat.ˎ(textView, drawable, ˎ[1], ˎ[2], ˎ[3]);
                break;
            case 1:
                TextViewCompat.ˎ(textView, ˎ[0], ˎ[1], drawable, ˎ[3]);
                break;
            case 2:
                TextViewCompat.ˎ(textView, drawable, compoundDrawables[1], compoundDrawables[2], compoundDrawables[3]);
                break;
            case 3:
                TextViewCompat.ˎ(textView, compoundDrawables[0], compoundDrawables[1], drawable, compoundDrawables[3]);
                break;
            case 4:
                TextViewCompat.ˎ(textView, compoundDrawables[0], drawable, compoundDrawables[2], compoundDrawables[3]);
                break;
            case 5:
                TextViewCompat.ˎ(textView, compoundDrawables[0], compoundDrawables[1], compoundDrawables[2], drawable);
                break;
        }
        if (VERSION.SDK_INT < 23) {
            Object tag = textView.getTag(e.ॱ);
            if (tag != null && (tag instanceof ColorStateList)) {
                ˎ(textView, (ColorStateList) tag);
            }
        }
    }

    private static void ˎ(TextView textView, ColorStateList colorStateList) {
        Drawable[] compoundDrawables = textView.getCompoundDrawables();
        Drawable[] drawableArr = new Drawable[compoundDrawables.length];
        Drawable[] ˎ = TextViewCompat.ˎ(textView);
        Drawable[] drawableArr2 = new Drawable[ˎ.length];
        if (compoundDrawables.length == 4 && ˎ.length == 4) {
            int i;
            Drawable drawable;
            for (i = 0; i < compoundDrawables.length; i++) {
                drawable = null;
                if (compoundDrawables[i] != null) {
                    drawable = gg.ʻ(compoundDrawables[i]).mutate();
                    gg.ॱ(drawable, colorStateList);
                    gg.ˋ(drawable, Mode.SRC_IN);
                }
                drawableArr[i] = drawable;
            }
            TextViewCompat.ˎ(textView, drawableArr[0], drawableArr[1], drawableArr[2], drawableArr[3]);
            for (i = 0; i < ˎ.length; i++) {
                drawable = null;
                if (ˎ[i] != null) {
                    drawable = gg.ʻ(ˎ[i]).mutate();
                    gg.ॱ(drawable, colorStateList);
                    gg.ˋ(drawable, Mode.SRC_IN);
                }
                drawableArr2[i] = drawable;
            }
            TextViewCompat.ˎ(textView, drawableArr2[0], drawableArr2[1], drawableArr2[2], drawableArr2[3]);
        }
    }
}
